import {
  addProfitReceiver,
  getPrepay,
  postProfitSharing,
  queryTrade,
} from "../../utils/wx/wxpay";

export async function testAdd1(body) {
  return addProfitReceiver({
    type: "PERSONAL_OPENID",
    account: body.account || "ojIoZ7Tf5Agyx6IOp-39eEHmfmtQ",
    // name: "xr",
    relation_type: "USER",
    sub_mchid: body.sub_mchid || "1700368603",
  });
}
export async function testAdd2() {
  return addProfitReceiver({
    type: "MERCHANT_ID",
    account: "1681606277",
    name: "济南爱希体育发展有限公司",
    relation_type: "SERVICE_PROVIDER",
    sub_mchid: "1700368603",
  });
}

export async function testProfit() {
  const data = await postProfitSharing({
    transaction_id: "4200002509202412021096647776",
    out_order_no: "202412021259303365",
    sub_mchid: "1700368603",
    receivers: [
      {
        type: "PERSONAL_OPENID",
        account: "ojIoZ7Tf5Agyx6IOp-39eEHmfmtQ",
        // name: 'xr',
        amount: 10,
        description: "test-to-xr",
      },
    ],
  });
  return data;
}

export async function testQuery(orderNo) {
  return queryTrade(orderNo);
}
